# -*- coding:UTF-8 -*-
from cmdb.models import BelongSysInfo

def del_belong_sys_info(equipment_no, cursor):
    belong_del_sql = 'delete from belong_sys_info where equipment_no="' + equipment_no + '"'
    cursor.execute(belong_del_sql)

def add_belong_sys_info(equipment_no, belong_sys_name, operator, cursor):
    belong_insert_sql = 'insert into belong_sys_info set equipment_no="' + equipment_no \
                                        + '",belong_sys_name="' + belong_sys_name + '",operator="' + operator + '"'
    cursor.execute(belong_insert_sql)

def filter_belong_sys_info(equipment_no):
    blRes = BelongSysInfo.objects.filter(equipment_no=equipment_no)
    return blRes